package com.djl.sqtg.service.impl;

import com.djl.sqtg.entity.GoodsSales;
import com.djl.sqtg.entity.Orders;
import com.djl.sqtg.mapper.OrderMapper;
import com.djl.sqtg.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class OrderServiceImpl implements IOrderService{
    @Autowired
    private OrderMapper orderMapper;

    @Override
    public Integer addOrder(Orders orders) {
        return orderMapper.addOrder(orders);
    }

    @Override
    public Integer deleteOrder(Integer oid) {
        return orderMapper.deleteOrder(oid);
    }

    @Override
    public Integer updateOrderState(Integer oid,Integer orderstate) {
        return orderMapper.updateOrderState(oid,orderstate);
    }

    @Override
    public Orders findOrdersByOid(Integer oid) {
        return orderMapper.findOrdersByOid(oid);
    }

    @Override
    public Orders findOrdersByOrdernumber(String ordernumber) {
        return orderMapper.findOrdersByOrdernumber(ordernumber);
    }

    @Override
    public List<Orders> getUserOrderByState(Integer uid, Integer state) {
        return orderMapper.getUserOrderByState(uid,state);
    }

    @Override
    public List<GoodsSales> goodsSalesByOrders(String date) {
        return orderMapper.goodsSalesByOrders(date);
    }

    @Override
    public List<GoodsSales> goodsSevenDaySalesByOrders(List<String> date) {
        return orderMapper.goodsSevenDaySalesByOrders(date);
    }

    @Override
    public List<GoodsSales> goodsMonthSalesByOrders(String month) {
        return orderMapper.goodsMonthSalesByOrders(month);
    }

    @Override
    public List<String> getGoosSales(String date) {
        return orderMapper.getGoosSales(date);
    }

    @Override
    public List<Orders> getAllOrders(Integer pageNum,  Integer pageSize) {
        return orderMapper.getAllOrders(pageNum,pageSize);
    }

    @Override
    public Integer getAllOrdersNum() {
        return orderMapper.getAllOrdersNum();
    }

//    @Override
//    public List<Orders> getOrdersBySearch(String dateSelect, String username, String telep, String ordernumber, Integer pageNum, Integer pageSize) {
//        return orderMapper.getOrdersBySearch(dateSelect,username,telep,ordernumber,pageNum,pageSize);
//    }
//
//    @Override
//    public Integer getOrdersNumBySearch(String dateSelect, String username, String telep, String ordernumber) {
//        return orderMapper.getOrdersNumBySearch(dateSelect,username,telep,ordernumber);
//    }

    @Override
    public List<Orders> getOrdersBySearch(String startDate,String endDate,String username, String colonelname,String telep, String ordernumber,Integer orderstate, Integer pageNum, Integer pageSize) {
        return orderMapper.getOrdersBySearch(startDate,endDate,username,colonelname,telep,ordernumber,orderstate,pageNum,pageSize);
    }

    @Override
    public Integer getOrdersNumBySearch(String startDate,String endDate,String username,String colonelname, String telep, String ordernumber,Integer orderstate) {
        return orderMapper.getOrdersNumBySearch(startDate,endDate,username,colonelname,telep,ordernumber,orderstate);
    }

    @Override
    public Float totalMoney() {
        return orderMapper.totalMoney();
    }

    @Override
    public Integer todayOrders(String date) {
        return orderMapper.todayOrders(date);
    }

    @Override
    public Float todayMoney(String date) {
        return orderMapper.todayMoney(date);
    }

    @Override
    public Integer orderSevenNum(String startDate, String endDate) {
        return orderMapper.orderSevenNum(startDate,endDate);
    }

    @Override
    public Float sevenTurnover(String startDate, String endDate) {
        return orderMapper.sevenTurnover(startDate,endDate);
    }

    @Override
    public List<Orders> getUserNoAcceptOrderByUidCid(Integer uid, Integer cid) {
        return orderMapper.getUserNoAcceptOrderByUidCid(uid,cid);
    }

    @Override
    public Orders getUserNoAcceptOrderByOrdernumber(String ordernumber) {
        return orderMapper.getUserNoAcceptOrderByOrdernumber(ordernumber);
    }

    @Override
    public Integer updateOrderStateByNum(String ordernumber, Integer orderstate) {
        return orderMapper.updateOrderStateByNum(ordernumber,orderstate);
    }

    @Override
    public List<Orders> getOrdersByState(Integer orderstate) {
        return orderMapper.getOrdersByState(orderstate);
    }

    @Override
    public Integer getSevenOrder(String date) {
        return orderMapper.getSevenOrder(date);
    }

    @Override
    public Float getTodayTurnover(String date) {
        return orderMapper.getTodayTurnover(date);
    }

    @Override
    public Integer getTodaySales(String date) {
        return orderMapper.getTodaySales(date);
    }

    @Override
    public Integer getCategoryWeekSales(Integer gcid, String date) {
        return orderMapper.getCategoryWeekSales(gcid,date);
    }

    @Override
    public String getCategoryNameByGcid(Integer gcid) {
        return orderMapper.getCategoryNameByGcid(gcid);
    }


//    @Override
//    public List<GoodsSales> findGoodsDaySalesByOrders(String date) {
//        return orderMapper.findGoodsDaySalesByOrders(date);
//    }
//
//    @Override
//    public List<GoodsSales> getGoodsBygids(Integer[] gids) {
//        return orderMapper.getGoodsBygids(gids);
//    }

}
